<?php
declare (strict_types=1);

use think\facade\Route;

// 课程考试管理
Route::group('admin/exam/<course_id>', function () {
    // 列表
    Route::get('/list', '@index');
    // 关联试卷
    Route::get('/create', '@create');
    // 关联试卷 - 提交
    Route::post('/create', '@create');
    Route::group('<paper_id>', function () {
        // 关联试卷
        Route::get('edit', '@edit');
        // 关联试卷 - 提交
        Route::put('edit', '@edit');
        // 关联试卷 - 删除
        Route::delete('delete', '@delete');
    })->pattern(['paper_id' => '\d+']);

    // 批量删除
    Route::delete('deletes/<ids>', '@deletes')->pattern(['ids' => '[\d,]+']);// 批量删除
    // 课程试卷
    Route::get('paper/choose/list', '@getChooseList');
    // 课程考试选择面板筛选条件
    Route::get('paper/choose/options', '@getChooseOptions');

})->prefix('\app\course\service\exam\admin\Paper')
    ->middleware(['adminRoute'])
    ->pattern(['course_id' => '\d+']);

// 课程考试记录
Route::group('admin/exam/<course_id>/<paper_id>/record', function () {
    // 列表
    Route::get('/list', '@getCourseExamRecord');

})->prefix('\app\course\service\exam\admin\Record')
    ->middleware(['adminRoute'])
    ->pattern(['course_id' => '\d+', 'paper_id' => '\d+']);